@echo off
REM SimpleOS Windows 运行脚本

echo ==========================================
echo   Starting SimpleOS in QEMU
echo ==========================================
echo.

REM 检查操作系统镜像是否存在
if not exist os-image.bin (
    echo [ERROR] OS image not found!
    echo Please run build.bat first
    pause
    exit /b 1
)

REM 检查 QEMU 是否安装
where qemu-system-i386 >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
    where qemu-system-x86_64 >nul 2>nul
    if %ERRORLEVEL% NEQ 0 (
        echo [ERROR] QEMU not found!
        echo Please install QEMU from: https://www.qemu.org/download/
        echo Or use: winget install qemu
        pause
        exit /b 1
    )
)

echo [INFO] Launching QEMU with 128MB RAM...
echo [INFO] Press Ctrl+C or close window to exit
echo.

REM 使用 QEMU 运行操作系统（软盘模式，兼容性最好）
where qemu-system-i386 >nul 2>nul
if %ERRORLEVEL% EQU 0 (
    qemu-system-i386 -fda os-image.bin -boot a
) else (
    qemu-system-x86_64 -fda os-image.bin -boot a
)

